﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QuanLyTruongMamNon.Man_Hinh
{
    public partial class frmNam_Hoc : Form
    {
        public frmNam_Hoc()
        {
            InitializeComponent();
        }
        public void HienThiNamHoc()
        {
            string sql = "select * from NAM_HOC";
            DataTable dt = new DataTable();
            dt=Thu_Vien.ExecuteQuery(sql);
            dtgNAMHOC.DataSource = dt;
           
           
            dtgNAMHOC.DataBindings.Add("text", dt, "Namhoc");
            //dtgNAMHOC.Columns[0].;

            txtNamHoc.DataBindings.Add("text",dt,"Namhoc");
            txtTenNam.DataBindings.Add("text",dt,"Tennamhoc");
            cboNgayKG.DataBindings.Add("text",dt,"NgayKg");
            cboNgayKT.DataBindings.Add("text",dt,"NgayKt");
        }

        private void frmNam_Hoc_Load(object sender, EventArgs e)
        {
            HienThiNamHoc();
        }

        
    }
}
